__author__ = 'cjay'

import os
exts = "jpg_png_qml_mp4_mp3_avi_ico".split("_")


def rec_files(path):
    res = []
    if not os.path.exists(path): return res
    for i in os.listdir(path):
        f = os.path.join(path,i)
        if os.path.isdir(f):
            res.extend(rec_files(f))
        else:
            if f.rsplit(".",1)[-1] in exts:
                res.append(f)
    return res
